<!--商户酒币记录-->
<div class="search">
  <nz-input-group nzSuffixIcon="anticon anticon-search" style="width:55%;margin-left:1rem;">
    <input type="text" nz-input placeholder="输入酒水名称" [(ngModel)]="name" (keyup.enter)="searchData()">
  </nz-input-group>
  <a (click)="searchData()">查询</a>
  <a (click)="applaySendWine()">申请送酒</a>
</div>

<nz-table #ajaxTable nzShowSizeChanger [nzFrontPagination]="false" [nzData]="dataSet" [nzLoading]="loading"
  [nzTotal]="total" [nzShowTotal]="totalTemplate" [(nzPageIndex)]="pageIndex" [(nzPageSize)]="pageSize"
  (nzPageIndexChange)="searchData()" (nzPageSizeChange)="searchData(true)" [nzScroll]="{ x:'800px',y: '400px' }">
  <thead>
    <tr>
      <th nzWidth="60px" nzLeft="0px">序号</th>
      <th nzWidth="100px">图片</th>
      <th nzWidth="100px">名称</th>
      <th nzWidth="100px">酒水类型</th>
      <th nzWidth="100px">香型</th>
      <th nzWidth="100px">酒精度</th>
      <th nzWidth="100px">容量</th>
      <th nzWidth="100px">价格(元/瓶)</th>
      <th nzWidth="100px">库存(瓶)</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of ajaxTable.data;index as i">
      <td nzLeft="0px">{{i+1}}</td>
      <td> <img *ngIf="data.img" [src]="data.img" class="avatar" style="width: 50px; height:50px;"></td>
      <td>{{data.winename}}</td>
      <td>{{data.typename}}</td>
      <td>{{data.Aroma}}</td>
      <td>{{data.Alcohol}}</td>
      <td>{{data.capacity}}</td>
      <td>{{data.price}}</td>
      <td>{{data.stock}}</td>
    </tr>
  </tbody>
</nz-table>

<ng-template #totalTemplate let-total>
  共 {{total}} 条
</ng-template>

<nz-modal [(nzVisible)]="isVisible" nzTitle="申请送酒" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"
  nzWrapClassName="vertical-center-modal" [nzMaskClosable]="false" nzWidth="800">
  <div style="margin-bottom: 16px;">
    <nz-input-group disabled="true" nzAddOnBefore="最大可申请数量(瓶)">
      <input type="text" disabled="true" nz-input [(ngModel)]="maxApplyCount">
    </nz-input-group>
    <nz-input-group disabled="true" nzAddOnBefore="已申请数量(瓶)">
      <input type="text" disabled="true" nz-input [(ngModel)]="appedCount">
    </nz-input-group>
    <div>
      <p><span>酒类设置</span></p>
      <table *ngIf="winelist">
        <thead>
          <tr>
            <th style="width: 30px;">图片</th>
            <th style="width: 150px;">酒水名称</th>
            <th style="width: 50px;">库存(瓶)</th>
            <th style="width: 50px;">可补货(瓶)</th>
            <th style="width: 50px;">规格(瓶/箱)</th>
            <th style="width: 50px;">申请配送(箱)</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let item of winelist;index as i">
            <td><img *ngIf="item.img" [src]="item.img" class="avatar" style="width: 20px; height:20px;"></td>
            <td><input type="text" readonly="true" nz-input [(ngModel)]="item.winename"></td>
            <td><input type="text" readonly="true" nz-input [(ngModel)]="item.stock"></td>
            <td><input type="text" readonly="true" nz-input [(ngModel)]="item.cnum"></td>
            <td><input type="text" readonly="true" nz-input [(ngModel)]="item.specs"></td>
            <nz-input-number disabled="true" [(ngModel)]="item.count" [nzMin]="0" [nzMax]="item.maxapp" [nzStep]="1">
            </nz-input-number>
            <!-- <td><input type="text" nz-input [(ngModel)]="item.count" oninput="this.value = this.value.replace(/[^0-9]/g, '');"></td> -->
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</nz-modal>